package com.anbang.app.base.fragment

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

/**
 * 功能描述：BaseFragment
 * 创建作者：AnBang
 * 创建时间：2018/6/7
 */
open abstract class BaseFragment : Fragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        val view = inflater!!.inflate(getLayoutId(), container, false)
        initView(view, savedInstanceState)
        return view
    }

    /**
     * 初始化相关
     */
    abstract fun initView(view: View?, savedInstanceState: Bundle?)

    /**
     * 设置布局
     */
    open abstract fun getLayoutId(): Int
}